#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QFileDialog>
#include <QDebug>
#include <QFileInfo>
#include <QDateTime>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    // 弹出对话框，获取
    QString path = QFileDialog::getOpenFileName(this);
    QFileInfo info(path);

    qDebug() << info.fileName();
    qDebug() << info.suffix();
    qDebug() << info.size();
    qDebug() << info.isFile();
    QDateTime time = info.fileTime(QFileDevice::FileBirthTime);
    qDebug() << time.toString("yyyy-MM-dd hh:mm:ss");
}
